package com.zbl.zblproject.pay.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbl.zblproject.pay.entity.PayOrderItem;
import com.zbl.zblproject.pay.vo.PayOrderItemVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/11/5
 */
@Repository
public interface PayOrderItemMapper extends BaseMapper<PayOrderItem> {


    @Select("SELECT * FROM zbl_pay_orderitem WHERE order_id = #{id}")
    List<PayOrderItem> selectListByOrderId(@Param("id") long orderId);




    List<PayOrderItemVo> selectListByTimeAndUserId(@Param("start") LocalDateTime start,
                                                 @Param("end") LocalDateTime end,
                                                 @Param("userId") int userId,
                                                 @Param("goodsName") String goodsName,
                                                 @Param("catId") int catId,
                                                 @Param("supId") int supId);

    List<PayOrderItemVo> selectOrderItemVo(@Param("userId") int userId,
                                           @Param("start") LocalDateTime start,
                                           @Param("end") LocalDateTime end);

    List<PayOrderItemVo> selectOrderItemVos(@Param("orderId") long orderId);

    List<PayOrderItemVo> getOrderListBySn(@Param("userId") int userId, @Param("orderSn") String orderSn);

    List<PayOrderItemVo> selectNum(@Param("start") LocalDateTime start,
                                                   @Param("end") LocalDateTime end
                                                   );
    List<PayOrderItemVo> selectOrderVoList(@Param("start") LocalDateTime start,
                                           @Param("end") LocalDateTime end);
}
